import config from '../../config'

export function nodeMouseEnter(e, obj) {
  // 修改填充色
  const shape = obj.findObject('NODE_SHAPE')
  if (shape) {
    // 亮度增加20%
    // shape.fill = go.Brush.lightenBy(config.node.style.fillColor, 0.2)
    shape.fill = go.Brush.lightenBy(config.node.style.stroke, 0.2)
  }
  // 修改文本颜色
  // const text = obj.findObject('NODE_TEXT')
  // if (text) {
  //   text.stroke = 'white'
  // }
}

export function nodeMouseLeave(e, obj) {
  // 修改填充色
  const shape = obj.findObject('NODE_SHAPE')
  if (shape) {
    // Return the Shape's fill and stroke to the defaults
    // shape.fill = config.node.style.fillColor
    shape.fill = config.node.style.stroke
    // shape.stroke = null
  }
  // 修改文本颜色
  // Return the TextBlock's stroke to its default
  // const text = obj.findObject('NODE_TEXT')
  // if (text) {
  //   text.stroke = 'black'
  // }
}
